#include "MyUtils.h"


std::wstring string_to_wstring(const std::string& wstr) {
    INT len = MultiByteToWideChar(CP_ACP, 0, wstr.c_str(), (INT)wstr.size(), NULL, 0);
    std::vector<wchar_t> buff(len);
    MultiByteToWideChar(CP_ACP, 0, wstr.c_str(), (INT)wstr.size(), &buff[0], len);
    return std::wstring(buff.begin(), buff.end());
}

std::string wstring_to_string(const std::wstring& wstr) {
    INT len = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), (INT)wstr.size(), NULL, 0, NULL, NULL);
    std::vector<char> buff(len);
    WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), (INT)wstr.size(), &buff[0], len, NULL, NULL);
    return std::string(buff.begin(), buff.end());
}